home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-rose-pop3-00.txt < prev    next >
Text File  |  1993-04-05  |  39KB  |  1,064 lines

  1. Draft                             POP3                            Apr 93
  2.  
  3.  
  4.               Post Office Protocol - Version 3
  5.  
  6.               Sat Apr  3 16:22:22 1993
  7.  
  8.                   Marshall T. Rose
  9.             Dover Beach Consulting, Inc.
  10.                mrose@dbc.mtview.ca.us
  11.  
  12.  
  13. Status of this Memo
  14.  
  15.           This document is an Internet Draft.  Internet Drafts are
  16.           working documents of the Internet Engineering Task Force
  17.           (IETF), its Areas, and its Working Groups.  Note that other
  18.           groups may also distribute working documents as Internet
  19.           Drafts.
  20.  
  21.           Internet Drafts are valid for a maximum of six months and may
  22.           be updated, replaced, or obsoleted by other documents at any
  23.           time.  It is inappropriate to use Internet Drafts as reference
  24.           material or to cite them other than as a "work in progress".
  25.  
  26.  
  27. Overview
  28.  
  29.    This memo is a PROPOSED revision to RFC 1225, a draft standard.  It
  30.    makes the following changes from that document:
  31.  
  32.     - the RPOP facility is removed;
  33.  
  34.     - the optional APOP facility is added (which is in interoperable,
  35.           operational use in at least three implementations);
  36.  
  37.     - a typo was corrected with respect to the interaction of LAST
  38.       and RSET;
  39.  
  40.         - section numbers were added; and,
  41.  
  42.     - an acknowledgements section was added.
  43.  
  44.  
  45.  
  46. 1. Introduction
  47.  
  48.    On certain types of smaller nodes in the Internet it is often
  49.    impractical to maintain a message transport system (MTS).  For
  50.    example, a workstation may not have sufficient resources (cycles,
  51.    disk space) in order to permit a SMTP server [RFC821] and associated local
  52.    mail delivery system to be kept resident and continuously running.
  53.  
  54.  
  55. Rose                                                            [Page 1]
  56.  
  57. Expires October 3, 1993           POP3                            Apr 93
  58.  
  59.  
  60.    Similarly, it may be expensive (or impossible) to keep a personal
  61.    computer interconnected to an IP-style network for long amounts of
  62.    time (the node is lacking the resource known as "connectivity").
  63.  
  64.    Despite this, it is often very useful to be able to manage mail on
  65.    these smaller nodes, and they often support a user agent (UA) to aid
  66.    the tasks of mail handling.  To solve this problem, a node which can
  67.    support an MTS entity offers a maildrop service to these less endowed
  68.    nodes.  The Post Office Protocol - Version 3 (POP3) is intended to
  69.    permit a workstation to dynamically access a maildrop on a server
  70.    host in a useful fashion.  Usually, this means that the POP3 is used
  71.    to allow a workstation to retrieve mail that the server is holding
  72.    for it.
  73.  
  74.    For the remainder of this memo, the term "client host" refers to a
  75.    host making use of the POP3 service, while the term "server host"
  76.    refers to a host which offers the POP3 service.
  77.  
  78.  
  79. 2. A Short Digression
  80.  
  81.    This memo does not specify how a client host enters mail into the
  82.    transport system, although a method consistent with the philosophy of
  83.    this memo is presented here:
  84.  
  85.       When the user agent on a client host wishes to enter a message
  86.       into the transport system, it establishes an SMTP connection to
  87.       its relay host (this relay host could be, but need not be, the
  88.       POP3 server host for the client host).
  89.  
  90.    If this method is followed, then the client host appears to the MTS
  91.    as a user agent, and should NOT be regarded as a "trusted" MTS entity
  92.    in any sense whatsoever.  This concept, along with the role of the
  93.    POP3 as a part of a split-UA model is discussed later in this memo.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. Rose                                                            [Page 2]
  112.  
  113. Expires October 3, 1993           POP3                            Apr 93
  114.  
  115.  
  116. 3. Basic Operation
  117.  
  118.    Initially, the server host starts the POP3 service by listening on
  119.    TCP port 110.  When a client host wishes to make use of the service,
  120.    it establishes a TCP connection with the server host.  When the
  121.    connection is established, the POP3 server sends a greeting.  The
  122.    client and POP3 server then exchange commands and responses
  123.    (respectively) until the connection is closed or aborted.
  124.  
  125.    Commands in the POP3 consist of a keyword possibly followed by an
  126.    argument.  All commands are terminated by a CRLF pair.
  127.  
  128.    Responses in the POP3 consist of a success indicator and a keyword
  129.    possibly followed by additional information.  All responses are
  130.    terminated by a CRLF pair.  There are currently two success
  131.    indicators: positive ("+OK") and negative ("-ERR").
  132.  
  133.    Responses to certain commands are multi-line.  In these cases, which
  134.    are clearly indicated below, after sending the first line of the
  135.    response and a CRLF, any additional lines are sent, each terminated
  136.    by a CRLF pair.  When all lines of the response have been sent, a
  137.    final line is sent, consisting of a termination octet (decimal code
  138.    046, ".") and a CRLF pair.  If any line of the multi-line response
  139.    begins with the termination octet, the line is "byte-stuffed" by
  140.    pre-pending the termination octet to that line of the response.
  141.  
  142.    Hence a multi-line response is terminated with the five octets
  143.    "CRLF.CRLF".  When examining a multi-line response, the client checks
  144.    to see if the line begins with the termination octet.  If so and if
  145.    octets other than CRLF follow, the the first octet of the line (the
  146.    termination octet) is stripped away.  If so and if CRLF immediately
  147.    follows the termination character, then the response from the POP
  148.    server is ended and the line containing ".CRLF" is not considered
  149.    part of the multi-line response.
  150.  
  151.    A POP3 session progresses through a number of states during its
  152.    lifetime.  Once the TCP connection has been opened and the POP3
  153.    server has sent the greeting, the session enters the AUTHORIZATION
  154.    state.  In this state, the client must identify itself to the POP3
  155.    server.  Once the client has successfully done this, the server
  156.    acquires resources associated with the client's maildrop, and the
  157.    session enters the TRANSACTION state.  In this state, the client
  158.    requests actions on the part of the POP3 server.  When the client has
  159.    finished its transactions, the session enters the UPDATE state.  In
  160.    this state, the POP3 server releases any resources acquired during
  161.    the TRANSACTION state and says goodbye.  The TCP connection is then
  162.    closed.
  163.  
  164.  
  165.  
  166.  
  167. Rose                                                            [Page 3]
  168.  
  169. Expires October 3, 1993           POP3                            Apr 93
  170.  
  171.  
  172. 4. The AUTHORIZATION State
  173.  
  174.    Once the TCP connection has been opened by a POP3 client, the POP3
  175.    server issues a one line greeting.  This can be any string terminated
  176.    by CRLF.  An example might be:
  177.  
  178.       S.  +OK POP3 server ready
  179.  
  180.    Note that this greeting is a POP3 reply.  The POP3 server should
  181.    always give a positive response as the greeting.
  182.  
  183.    The POP3 session is now in the AUTHORIZATION state.  The client must
  184.    now issue the USER command.  If the POP3 server responds with a
  185.    positive success indicator ("+OK"), then the client may issue either
  186.    the PASS command to complete the authorization, or the QUIT command
  187.    to terminate the POP3 session.  If the POP3 server responds with a
  188.    negative success indicator ("-ERR") to the USER command, then the
  189.    client may either issue a new USER command or may issue the QUIT
  190.    command.
  191.  
  192.    When the client issues the PASS command, the POP3 server uses the
  193.    argument pair from the USER and PASS commands to determine if the
  194.    client should be given access to the appropriate maildrop.  If so,
  195.    the POP3 server then acquires an exclusive-access lock on the
  196.    maildrop.  If the lock is successfully acquired, the POP3 server
  197.    parses the maildrop into individual messages (read note below),
  198.    determines the last message (if any) present in the maildrop that was
  199.    referenced by the RETR command, and responds with a positive success
  200.    indicator.  The POP3 session now enters the TRANSACTION state.  If
  201.    the lock can not be acquired or the client should is denied access to
  202.    the appropriate maildrop or the maildrop can't be parsed for some
  203.    reason, the POP3 server responds with a negative success indicator.
  204.    (If a lock was acquired but the POP3 server intends to respond with a
  205.    negative success indicator, the POP3 server must release the lock
  206.    prior to rejecting the command.)  At this point, the client may
  207.    either issue a new USER command and start again, or the client may
  208.    issue the QUIT command.
  209.  
  210.                  NOTE: Minimal implementations of the POP3 need only be
  211.                  able to break a maildrop into its component messages;
  212.                  they need NOT be able to parse individual messages.
  213.                  More advanced implementations may wish to have this
  214.                  capability, for reasons discussed later.
  215.  
  216.    After the POP3 server has parsed the maildrop into individual
  217.    messages, it assigns a message-id to each message, and notes the size
  218.    of the message in octets.  The first message in the maildrop is
  219.    assigned a message-id of "1", the second is assigned "2", and so on,
  220.    so that the n'th message in a maildrop is assigned a message-id of
  221.  
  222.  
  223. Rose                                                            [Page 4]
  224.  
  225. Expires October 3, 1993           POP3                            Apr 93
  226.  
  227.  
  228.    "n".  In POP3 commands and responses, all message-id's and message
  229.    sizes are expressed in base-10 (i.e., decimal).
  230.  
  231.    It sets the "highest number accessed" to be that of the last message
  232.    referenced by the RETR command.
  233.  
  234.    Here are summaries for the three POP3 commands discussed thus far:
  235.  
  236.            USER name
  237.                Arguments: a server specific user-id (required)
  238.                Restrictions: may only be given in the AUTHORIZATION
  239.                    state after the POP3 greeting or after an
  240.                    unsuccessful USER or PASS command
  241.                Possible Responses:
  242.                    +OK name is welcome here
  243.                    -ERR never heard of name
  244.                Examples:
  245.                    C:    USER mrose
  246.                    S:    +OK mrose is a real hoopy frood
  247.                      ...
  248.                    C:    USER frated
  249.                    S:    -ERR sorry, frated doesn't get his mail here
  250.  
  251.            PASS string
  252.                Arguments: a server/user-id specific password (required)
  253.                Restrictions: may only be given in the AUTHORIZATION
  254.                    state after a successful USER command
  255.                Possible Responses:
  256.                    +OK maildrop locked and ready
  257.                    -ERR invalid password
  258.                    -ERR unable to lock maildrop
  259.                Examples:
  260.                    C:    USER mrose
  261.                    S:    +OK mrose is a real hoopy frood
  262.                    C:    PASS secret
  263.                    S:    +OK mrose's maildrop has 2 messages
  264.                          (320 octets)
  265.                      ...
  266.                    C:    USER mrose
  267.                    S:    +OK mrose is a real hoopy frood
  268.                    C:    PASS secret
  269.                    S:    -ERR unable to lock mrose's maildrop, file
  270.                          already locked
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279. Rose                                                            [Page 5]
  280.  
  281. Expires October 3, 1993           POP3                            Apr 93
  282.  
  283.  
  284.            QUIT
  285.                Arguments: none
  286.                Restrictions: none
  287.                Possible Responses:
  288.                    +OK
  289.                Examples:
  290.                    C:    QUIT
  291.                    S:    +OK dewey POP3 server signing off
  292.  
  293.  
  294. 5. The TRANSACTION State
  295.  
  296.    Once the client has successfully identified itself to the POP3 server
  297.    and the POP3 server has locked and burst the appropriate maildrop,
  298.    the POP3 session is now in the TRANSACTION state.  The client may now
  299.    issue any of the following POP3 commands repeatedly.  After each
  300.    command, the POP3 server issues a response.  Eventually, the client
  301.    issues the QUIT command and the POP3 session enters the UPDATE state.
  302.  
  303.    Here are the POP3 commands valid in the TRANSACTION state:
  304.  
  305.            STAT
  306.                Arguments: none
  307.                Restrictions: may only be given in the TRANSACTION state.
  308.                Discussion:
  309.  
  310.                  The POP3 server issues a positive response with a line
  311.                  containing information for the maildrop.  This line is
  312.                  called a "drop listing" for that maildrop.
  313.  
  314.                  In order to simplify parsing, all POP3 servers are
  315.                  required to use a certain format for drop listings.
  316.                  The first octets present must indicate the number of
  317.                  messages in the maildrop.  Following this is the size
  318.                  of the maildrop in octets.  This memo makes no
  319.                  requirement on what follows the maildrop size.
  320.                  Minimal implementations should just end that line of
  321.                  the response with a CRLF pair.  More advanced
  322.                  implementations may include other information.
  323.  
  324.                       NOTE: This memo STRONGLY discourages
  325.                       implementations from supplying additional
  326.                       information in the drop listing.  Other,
  327.                       optional, facilities are discussed later on
  328.                       which permit the client to parse the messages
  329.                       in the maildrop.
  330.  
  331.                  Note that messages marked as deleted are not counted in
  332.                  either total.
  333.  
  334.  
  335. Rose                                                            [Page 6]
  336.  
  337. Expires October 3, 1993           POP3                            Apr 93
  338.  
  339.  
  340.                Possible Responses:
  341.                    +OK nn mm
  342.                Examples:
  343.                    C:    STAT
  344.                    S:    +OK 2 320
  345.  
  346.            LIST [msg]
  347.                Arguments: a message-id (optionally)  If a message-id is
  348.                    given, it may NOT refer to a message marked as
  349.                    deleted.
  350.                Restrictions: may only be given in the TRANSACTION state.
  351.                Discussion:
  352.  
  353.                  If an argument was given and the POP3 server issues a
  354.                  positive response with a line containing information
  355.                  for that message.  This line is called a "scan listing"
  356.                  for that message.
  357.  
  358.                  If no argument was given and the POP3 server issues a
  359.                  positive response, then the response given is
  360.                  multi-line.  After the initial +OK, for each message
  361.                  in the maildrop, the POP3 server responds with a line
  362.                  containing information for that message.  This line
  363.                  is called a "scan listing" for that message.
  364.  
  365.                  In order to simplify parsing, all POP3 servers are
  366.                  required to use a certain format for scan listings.
  367.                  The first octets present must be the message-id of
  368.                  the message.  Following the message-id is the size of
  369.                  the message in octets.  This memo makes no requirement
  370.                  on what follows the message size in the scan listing.
  371.                  Minimal implementations should just end that line of
  372.                  the response with a CRLF pair.  More advanced
  373.                  implementations may include other information, as
  374.                  parsed from the message.
  375.  
  376.                       NOTE: This memo STRONGLY discourages
  377.                       implementations from supplying additional
  378.                       information in the scan listing.  Other, optional,
  379.                       facilities are discussed later on which permit
  380.                       the client to parse the messages in the maildrop.
  381.  
  382.                  Note that messages marked as deleted are not listed.
  383.  
  384.                Possible Responses:
  385.                    +OK scan listing follows
  386.                    -ERR no such message
  387.  
  388.  
  389.  
  390.  
  391. Rose                                                            [Page 7]
  392.  
  393. Expires October 3, 1993           POP3                            Apr 93
  394.  
  395.  
  396.                Examples:
  397.                    C:    LIST
  398.                    S:    +OK 2 messages (320 octets)
  399.                    S:    1 120
  400.                    S:    2 200
  401.                    S:    .
  402.                      ...
  403.                    C:    LIST 2
  404.                    S:    +OK 2 200
  405.                      ...
  406.                    C:    LIST 3
  407.                    S:    -ERR no such message, only 2 messages in
  408.                          maildrop
  409.  
  410.            RETR msg
  411.                Arguments: a message-id (required)  This message-id may
  412.                    NOT refer to a message marked as deleted.
  413.                Restrictions: may only be given in the TRANSACTION state.
  414.                Discussion:
  415.  
  416.                  If the POP3 server issues a positive response, then the
  417.                  response given is multi-line.  After the initial +OK,
  418.                  the POP3 server sends the message corresponding to the
  419.                  given message-id, being careful to byte-stuff the
  420.                  termination character (as with all multi-line
  421.                  responses).
  422.  
  423.                  If the number associated with this message is higher
  424.                  than the "highest number accessed" in the maildrop, the
  425.                  POP3 server updates the "highest number accessed" to
  426.                  the number associated with this message.
  427.  
  428.                Possible Responses:
  429.                    +OK message follows
  430.                    -ERR no such message
  431.                Examples:
  432.                    C:    RETR 1
  433.                    S:    +OK 120 octets
  434.                    S:    <the POP3 server sends the entire message here>
  435.                    S:    .
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. Rose                                                            [Page 8]
  448.  
  449. Expires October 3, 1993           POP3                            Apr 93
  450.  
  451.            DELE msg
  452.                Arguments: a message-id (required)  This message-id
  453.                    may NOT refer to a message marked as deleted.
  454.                Restrictions: may only be given in the TRANSACTION state.
  455.                Discussion:
  456.  
  457.                  The POP3 server marks the message as deleted.  Any
  458.                  future reference to the message-id associated with the
  459.                  message in a POP3 command generates an error.  The POP3
  460.                  server does not actually delete the message until the
  461.                  POP3 session enters the UPDATE state.
  462.  
  463.                  If the number associated with this message is higher
  464.                  than the "highest number accessed" in the maildrop,
  465.                  the POP3 server updates the "highest number accessed"
  466.                  to the number associated with this message.
  467.  
  468.                Possible Responses:
  469.                    +OK message deleted
  470.                    -ERR no such message
  471.                Examples:
  472.                    C:    DELE 1
  473.                    S:    +OK message 1 deleted
  474.                      ...
  475.                    C:    DELE 2
  476.                    S:    -ERR message 2 already deleted
  477.  
  478.            NOOP
  479.                Arguments: none
  480.                Restrictions: may only be given in the TRANSACTION state.
  481.                Discussion:
  482.  
  483.                  The POP3 server does nothing, it merely replies with a
  484.                  positive response.
  485.  
  486.                Possible Responses:
  487.                    +OK
  488.                Examples:
  489.                    C:    NOOP
  490.                    S:    +OK
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503. Rose                                                            [Page 9]
  504.  
  505. Expires October 3, 1993           POP3                            Apr 93
  506.  
  507.  
  508.            LAST
  509.                Arguments: none
  510.                Restrictions: may only be issued in the TRANSACTION state.
  511.                Discussion:
  512.  
  513.                  The POP3 server issues a positive response with a line
  514.                  containing the highest message number which accessed.
  515.                  Zero is returned in case no message in the maildrop has
  516.                  been accessed during previous transactions.  A client
  517.                  may thereafter infer that messages, if any, numbered
  518.                  greater than the response to the LAST command are
  519.                  messages not yet accessed by the client.
  520.  
  521.              Possible Response:
  522.                    +OK nn
  523.  
  524.              Examples:
  525.                    C:      STAT
  526.                    S:      +OK 4 320
  527.                    C:      LAST
  528.                    S:      +OK 1
  529.                    C:      RETR 3
  530.                    S:      +OK 120 octets
  531.                    S:      <the POP3 server sends the entire message
  532.                            here>
  533.                    S:      .
  534.                    C:      LAST
  535.                    S:      +OK 3
  536.                    C:      DELE 2
  537.                    S:      +OK message 2 deleted
  538.                    C:      LAST
  539.                    S:      +OK 3
  540.                    C:      RSET
  541.                    S:      +OK
  542.                    C:      LAST
  543.                    S:      +OK 0
  544.  
  545.            RSET
  546.                Arguments: none
  547.                Restrictions: may only be given in the TRANSACTION
  548.                    state.
  549.                Discussion:
  550.  
  551.                  If any messages have been marked as deleted by the POP3
  552.                  server, they are unmarked.  The POP3 server then
  553.                  replies with a positive response.  In addition, the
  554.                  "highest number accessed" is also reset to zero.
  555.  
  556.  
  557.  
  558.  
  559. Rose                                                           [Page 10]
  560.  
  561. Expires October 3, 1993           POP3                            Apr 93
  562.  
  563.  
  564.                Possible Responses:
  565.                    +OK
  566.                Examples:
  567.                    C:    RSET
  568.                    S:    +OK maildrop has 2 messages (320 octets)
  569.  
  570.  
  571. 6. The UPDATE State
  572.  
  573.    When the client issues the QUIT command from the TRANSACTION state,
  574.    the POP3 session enters the UPDATE state.  (Note that if the client
  575.    issues the QUIT command from the AUTHORIZATION state, the POP3
  576.    session terminates but does NOT enter the UPDATE state.)
  577.  
  578.            QUIT
  579.                Arguments: none
  580.                Restrictions: none
  581.                Discussion:
  582.  
  583.                  The POP3 server removes all messages marked as deleted
  584.                  from the maildrop.  It then releases the
  585.                  exclusive-access lock on the maildrop and replies as
  586.                  to the success of
  587.                  these operations.  The TCP connection is then closed.
  588.  
  589.                Possible Responses:
  590.                    +OK
  591.                Examples:
  592.                    C:    QUIT
  593.                    S:    +OK dewey POP3 server signing off (maildrop
  594.                          empty)
  595.                      ...
  596.                    C:    QUIT
  597.                    S:    +OK dewey POP3 server signing off (2 messages
  598.                          left)
  599.                      ...
  600.  
  601.  
  602. 7. Optional POP3 Commands
  603.  
  604.    The POP3 commands discussed above must be supported by all minimal
  605.    implementations of POP3 servers.
  606.  
  607.    The optional POP3 commands described below permit a POP3 client
  608.    greater freedom in message handling, while preserving a simple POP3
  609.    server implementation.
  610.  
  611.  
  612.  
  613.  
  614.  
  615. Rose                                                           [Page 11]
  616.  
  617. Expires October 3, 1993           POP3                            Apr 93
  618.  
  619.  
  620.                  NOTE: This memo STRONGLY encourages implementations to
  621.                  support these commands in lieu of developing augmented
  622.                  drop and scan listings.  In short, the philosophy of
  623.                  this memo is to put intelligence in the part of the
  624.                  POP3 client and not the POP3 server.
  625.  
  626.            TOP msg n
  627.                Arguments: a message-id (required) and a number.  This
  628.                    message-id may NOT refer to a message marked as
  629.                    deleted.
  630.                Restrictions: may only be given in the TRANSACTION state.
  631.                Discussion:
  632.  
  633.                  If the POP3 server issues a positive response, then
  634.                  the response given is multi-line.  After the initial
  635.                  +OK, the POP3 server sends the headers of the message,
  636.                  the blank line separating the headers from the body,
  637.                  and then the number of lines indicated message's body,
  638.                  being careful to byte-stuff the termination character
  639.                  (as with all multi-line responses).
  640.  
  641.                  Note that if the number of lines requested by the POP3
  642.                  client is greater than than the number of lines in the
  643.                  body, then the POP3 server sends the entire message.
  644.  
  645.                Possible Responses:
  646.                    +OK top of message follows
  647.                    -ERR no such message
  648.                Examples:
  649.                    C:    TOP 10
  650.                    S:    +OK
  651.                    S:    <the POP3 server sends the headers of the
  652.                           message, a blank line, and the first 10 lines
  653.                           of the body of the message>
  654.                    S:    .
  655.                      ...
  656.                    C:    TOP 100
  657.                    S:    -ERR no such message
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671. Rose                                                           [Page 12]
  672.  
  673. Expires October 3, 1993           POP3                            Apr 93
  674.  
  675.            APOP name digest
  676.                Arguments: a client specific user-id (required) and a
  677.            digest string.
  678.                Restrictions: may only be given in the AUTHORIZATION
  679.                    state after a successful USER command
  680.                Discussion:
  681.  
  682.                  Normally, each POP3 session starts with a USER/PASS exchange.
  683.                  This results in a server/user-id specific password being sent
  684.                  in the clear on the network.  For intermittent use of POP3,
  685.                  the may not introduce a sizable risk.  However, many POP3
  686.                  client implementations connect to the POP3 server on a regular
  687.                  basis -- to check for new mail.  Further the interval of
  688.                  session initiation may be on the order of five minutes.
  689.                  Hence, the risk of password capture is greatly enhanced.
  690.  
  691.                  An alternate method of authentication is required which
  692.                  provides for both origin authentication and replay protection,
  693.                  but which does not involve sending a password in the clear
  694.                  over the network.  The APOP command provides this
  695.                  functionality.
  696.  
  697.                  A POP3 server which implements the APOP command will include a
  698.                  timestamp in its banner greeting.  The syntax of the timestamp
  699.                  corresponds to the `msg-id' in [RFC822], and MUST be different
  700.                  each time the POP3 server issues a banner greeting.  For
  701.                  example, on a UNIX implementation in which a separate UNIX
  702.                  process is used for each instance of a POP3 server, the syntax
  703.                  of the timestamp might be:
  704.  
  705.                     <process-ID.clock@hostname>
  706.  
  707.                  where `process-ID' is the decimal value of the process's PID,
  708.                  clock is the decimal value of the system clock, and hostname
  709.                  is the fully-qualified domain-name corresponding to the host
  710.                  where the POP3 server is running.
  711.  
  712.                  The POP3 client makes note of this timestamp, and then issues
  713.                  the APOP command.  The `name' parameter has identical
  714.          semantics to the `name' parameter of the USER command. The
  715.          `digest' parameter is calculated by applying the MD5 algorithm
  716.          [RFC1321] to a string consisting of the timestamp (including
  717.                  angle-brackets) followed by a shared secret.  This shared
  718.                  secret is a string known only to the POP3 client and server.
  719.            Great care should be taken to prevent unauthorized disclosure
  720.          of the secret, as knowledge of the secret will allow any
  721.                  entity to successfully masquerade as the named user.  The
  722.          `digest' parameter itself is a 16-octet value which is sent in
  723.                  hexadecimal format.
  724.  
  725.  
  726.  
  727. Rose                                                           [Page 13]
  728.  
  729. Expires October 3, 1993           POP3                            Apr 93
  730.  
  731.  
  732.                  When the POP3 server receives the APOP command, it verifies
  733.                  the digest provided.  If the digest is correct, the POP3
  734.          server issues a positive response, and the POP3 session enters
  735.          the TRANSACTION state.  Otherwise, a negative response is
  736.                  issued and the POP3 session remains in the AUTHORIZATION
  737.                  state.
  738.  
  739.                Possible Responses:
  740.                    +OK maildrop locked and ready
  741.                    -ERR permission denied
  742.                Examples:
  743.                    S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
  744.                    C: USER mrose
  745.                    S: +OK password required for mrose
  746.                    C: APOP c4c9334bac560ecc979e58001b3e22fb
  747.                    S: +OK maildrop has 1 message (369 octets)
  748.  
  749.                  In this example, the shared secret is the string `tanstaaf'.
  750.                  Hence, the MD5 algorithm is applied to the string
  751.  
  752.                     <1896.697170952@dbc.mtview.ca.us>tanstaaf
  753.  
  754.                  which produces a digest value of
  755.  
  756.                     c4c9334bac560ecc979e58001b3e22fb
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783. Rose                                                           [Page 14]
  784.  
  785. Expires October 3, 1993           POP3                            Apr 93
  786.  
  787. 8. POP3 Command Summary 
  788.  
  789.        Minimal POP3 Commands:
  790.            USER name               valid in the AUTHORIZATION state
  791.            PASS string
  792.            QUIT
  793.  
  794.            STAT                    valid in the TRANSACTION state
  795.            LIST [msg]
  796.            RETR msg
  797.            DELE msg
  798.            NOOP
  799.            LAST
  800.            RSET
  801.  
  802.            QUIT                    valid in the UPDATE state
  803.  
  804.        Optional POP3 Commands:
  805.            APOP user digest        valid in the AUTHORIZATION state
  806.  
  807.            TOP msg n               valid in the TRANSACTION state
  808.  
  809.        POP3 Replies:
  810.            +OK
  811.            -ERR
  812.  
  813.        Note that with the exception of the STAT command, the reply given
  814.        by the POP3 server to any command is significant only to "+OK"
  815.        and "-ERR".  Any text occurring after this reply may be ignored
  816.        by the client.
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839. Rose                                                           [Page 15]
  840.  
  841. Expires October 3, 1993           POP3                            Apr 93
  842.  
  843. 9. Example POP3 Session
  844.  
  845.     S: <wait for connection on TCP port 110>
  846.         ...
  847.     C: <open connection>
  848.     S:    +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
  849.     C:    USER mrose
  850.     S:    +OK password required for mrose
  851.     C:    APOP c4c9334bac560ecc979e58001b3e22fb
  852.     S:    +OK mrose's maildrop has 2 messages (320 octets)
  853.     C:    STAT
  854.     S:    +OK 2 320
  855.     C:    LIST
  856.     S:    +OK 2 messages (320 octets)
  857.     S:    1 120
  858.     S:    2 200
  859.     S:    .
  860.     C:    RETR 1
  861.     S:    +OK 120 octets
  862.     S:    <the POP3 server sends message 1>
  863.     S:    .
  864.     C:    DELE 1
  865.     S:    +OK message 1 deleted
  866.     C:    RETR 2
  867.     S:    +OK 200 octets
  868.     S:    <the POP3 server sends message 2>
  869.     S:    .
  870.     C:    DELE 2
  871.     S:    +OK message 2 deleted
  872.     C:    QUIT
  873.     S:    +OK dewey POP3 server signing off (maildrop empty)
  874.     C:  <close connection>
  875.     S:  <wait for next connection>
  876.  
  877.  
  878. 10. Message Format
  879.  
  880.    All messages transmitted during a POP3 session are assumed to conform
  881.    to the standard for the format of Internet text messages [RFC822].
  882.  
  883.    It is important to note that the byte count for a message on the
  884.    server host may differ from the octet count assigned to that message
  885.    due to local conventions for designating end-of-line.  Usually,
  886.    during the AUTHORIZATION state of the POP3 session, the POP3 client
  887.    can calculate the size of each message in octets when it parses the
  888.    maildrop into messages.  For example, if the POP3 server host
  889.    internally represents end-of-line as a single character, then the
  890.    POP3 server simply counts each occurrence of this character in a
  891.    message as two octets.  Note that lines in the message which start
  892.    with the termination octet need not be counted twice, since the POP3
  893.  
  894.  
  895. Rose                                                           [Page 16]
  896.  
  897. Expires October 3, 1993           POP3                            Apr 93
  898.  
  899.  
  900.    client will remove all byte-stuffed termination characters when it
  901.    receives a multi-line response.
  902.  
  903.  
  904. 11. The POP and the Split-UA model
  905.  
  906.    The underlying paradigm in which the POP3 functions is that of a
  907.    split-UA model.  The POP3 client host, being a remote PC based
  908.    workstation, acts solely as a client to the message transport system.
  909.    It does not provide delivery/authentication services to others.
  910.    Hence, it is acting as a UA, on behalf of the person using the
  911.    workstation.  Furthermore, the workstation uses SMTP to enter mail
  912.    into the MTS.
  913.  
  914.    In this sense, we have two UA functions which interface to the
  915.    message transport system: Posting (SMTP) and Retrieval (POP3).  The
  916.    entity which supports this type of environment is called a split-UA
  917.    (since the user agent is split between two hosts which must
  918.    interoperate to provide these functions).
  919.  
  920.                  ASIDE:  Others might term this a remote-UA instead.
  921.                  There are arguments supporting the use of both terms.
  922.  
  923.    This memo has explicitly referenced TCP as the underlying transport
  924.    agent for the POP3.  This need not be the case.  In the MZnet split-
  925.    UA, for example, personal micro-computer systems are used which do
  926.    not have IP-style networking capability [MZnet].  To connect to the POP3
  927.    server host, a PC establishes a terminal connection using some simple
  928.    protocol (PhoneNet).  A program on the PC drives the connection,
  929.    first establishing a login session as a normal user.  The login shell
  930.    for this pseudo-user is a program which drives the other half of the
  931.    terminal protocol and communicates with one of two servers.  Although
  932.    MZnet can support several PCs, a single pseudo-user login is present
  933.    on the server host.  The user-id and password for this pseudo-user
  934.    login is known to all members of MZnet.  Hence, the first action of
  935.    the login shell, after starting the terminal protocol, is to demand a
  936.    USER/PASS authorization pair from the PC.  This second level of
  937.    authorization is used to ascertain who is interacting with the MTS.
  938.    Although the server host is deemed to support a "trusted" MTS entity,
  939.    PCs in MZnet are not.  Naturally, the USER/PASS authorization pair
  940.    for a PC is known only to the owner of the PC (in theory, at least).
  941.  
  942.    After successfully verifying the identity of the client, a modified
  943.    SMTP server is started, and the PC posts mail with the server host.
  944.    After the QUIT command is given to the SMTP server and it terminates,
  945.    a modified POP3 server is started, and the PC retrieves mail from the
  946.    server host.  After the QUIT command is given to the POP3 server and
  947.    it terminates, the login shell for the pseudo-user terminates the
  948.    terminal protocol and logs the job out.  The PC then closes the
  949.  
  950.  
  951. Rose                                                           [Page 17]
  952.  
  953. Expires October 3, 1993           POP3                            Apr 93
  954.  
  955.  
  956.    terminal connection to the server host.
  957.  
  958.    The SMTP server used by MZnet is modified in the sense that it knows
  959.    that it's talking to a user agent and not a "trusted" entity in the
  960.    message transport system.  Hence, it does performs the validation
  961.    activities normally performed by an entity in the MTS when it accepts
  962.    a message from a UA.
  963.  
  964.    The POP3 server used by MZnet is modified in the sense that it does
  965.    not require a USER/PASS combination before entering the TRANSACTION
  966.    state.  The reason for this (of course) is that the PC has already
  967.    identified itself during the second-level authorization step
  968.    described above.
  969.  
  970.                  NOTE: Truth in advertising laws require that the author
  971.                  of this memo state that MZnet has not actually been
  972.                  fully implemented.  The concepts presented and proven
  973.                  by the project led to the notion of the MZnet
  974.                  split-slot model.  This notion has inspired the
  975.                  split-UA concept described in this memo, led to the
  976.                  author's interest in the POP, and heavily influenced
  977.                  the the description of the POP3 herein.
  978.  
  979.    In fact, some UAs present in the Internet already support the notion
  980.    of posting directly to an SMTP server and retrieving mail directly
  981.    from a POP3 server, even if the POP3 server and client resided on the
  982.    same host!
  983.  
  984.                  ASIDE: this discussion raises an issue which this memo
  985.                  purposedly avoids: how does SMTP know that it's talking
  986.                  to a "trusted" MTS entity?
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007. Rose                                                           [Page 18]
  1008.  
  1009. Expires October 3, 1993           POP3                            Apr 93
  1010.  
  1011.  
  1012. 12. References
  1013.  
  1014.      [MZnet]   Stefferud, E., J. Sweet, and T. Domae, "MZnet: Mail
  1015.                Service for Personal Micro-Computer Systems",
  1016.                Proceedings, IFIP 6.5 International Conference on
  1017.                Computer Message Systems, Nottingham, U.K., May 1984.
  1018.  
  1019.      [RFC821]  Postel, J., "Simple Mail Transfer Protocol",
  1020.                USC/Information Sciences Institute, August 1982.
  1021.  
  1022.      [RFC822]  Crocker, D., "Standard for the Format of ARPA-Internet
  1023.                Text Messages", University of Delaware, August 1982.
  1024.  
  1025.      [RFC1321] Rivest, R. "The MD5 Message-Digest Algorithm", MIT
  1026.            Laboratory for Computer Science, April 1992.
  1027.  
  1028.  
  1029. 13. Security Considerations
  1030.  
  1031.    It is conjectured that use of the APOP command provides origin
  1032.    identification and replay protection for a POP3 session.  Otherwise,
  1033.    security issues are not discussed in this memo.
  1034.  
  1035.  
  1036. 14. Acknowledgements
  1037.  
  1038.    The POP family has a long and checkered history.  Although primarily
  1039.    a minor revision to [RFC1225], POP3 is based on the ideas presented in
  1040.    RFCs 918, 937, and 1081.
  1041.  
  1042.    In addition, Alfred Grimstad, Keith McCloghrie, and Neil Ostroff
  1043.    provided significant comments on the APOP command.
  1044.  
  1045.  
  1046. 15. Author's Address:
  1047.  
  1048.    Marshall T. Rose
  1049.    Dover Beach Consulting, Inc.
  1050.    Mountain View, CA  94043-2186
  1051.  
  1052.    Phone: +1 415 968 1052
  1053.    Fax:   +1 415 968 2510
  1054.  
  1055.    EMail: mrose@dbc.mtview.ca.us
  1056.    X.500:  rose, psi, us
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063. Rose                                                           [Page 19]
  1064.